
<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
<!-- 编辑器公式插件 -->
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/addKityFormulaDialog.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/getKfContent.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/defaultFilterFix.js"></script>
<script type="text/javascript" src="/My97DatePicker/WdatePicker.js"></script>
<style>
    #login-button{
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
        border-radius: 3px;
    }
    .addBtn{
        text-decoration: none;
        background: #337ab7;
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        margin-bottom:10px;
        display: inline-block;
    }

</style>

<div class="span10">
    <div style="margin-bottom: 20px">
        <a href="/index/index">首页</a><span >&gt;</span><span>资讯管理</span><span >&gt;</span><span>添加/修改</span>
    </div>
    <form name="form" method="post" action="<?php echo baseUrl."/content/recommend/add"?>" enctype="multipart/form-data">
        <table>
            <tr>
                <td width="80px">标题 *:</td>
                <td><input type="text" name="name" placeholder="标题" style="width: 500px;" value="<?php echo isset($data)? $data['name']:''?>"></td>
            </tr>
            <tr>
                <td width="80px">链接 *:</td>
                <td><input type="text" name="url" placeholder="链接" style="width: 500px;" value="<?php echo isset($data)? $data['name']:''?>"></td>
            </tr>
            <tr>
                <td>网站 *:</td>
                <td>
                    <select name="type" id="type" >
                        <option value ="1" <?php echo isset($data)&& $data['type']=="1" ?  'selected=selected':''?>>WAP</option>
                        <option value ="2" <?php echo isset($data)&& $data['type']=="2" ?  'selected=selected':''?>>PC</option>
                    </select>
                </td>
            </tr>

            <tr>
                <td>排序:</td>
                <td>
                    <input type="text" name="sort" value="<?php echo isset($data) ? $data['sort']:''?>"  />
                </td>
            </tr>

            <tr>
                <td colspan="2" align="right">
                    <input type="hidden" name='id' value="<?php echo isset($data)? $data['id']:''?>"/>
                    <button type="submit" id="login-button">添加/修改</button>
                </td>
            </tr>
            <input type="hidden" name="_csrf" value="<?=Yii::$app->request->getCsrfToken()?>" />
        </table>
    </form>

</div>

<script type="text/javascript">
    $('.link-update').click(function(){
        var isTop = $(".isTop").val();
        if (isTop == "1") {
            $(".isTop").val("0");
            $(".link-update").text("置顶");
        } else {
            $(".isTop").val("1");
            $(".link-update").text("取消置顶");
        }
    })

</script>


